<?php

class User_model extends CI_Model {

    function User_model() {
        parent::__construct();
    }

    function authentification($login,$mdp) {
        $this->db->where('username', $login);
        $this->db->where('password', $mdp);
        $q = $this->db->get('users');
        if($q->num_rows() > 0){
            $unUser = $q->result('class_admin');
            return $unUser[0];
        }
        else {
            return "0";
        }
    }

}

?>
